<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('培训证书列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>
                        <li>
                            <label>课程名称：</label>
                            <input type="text" name="courseName"/>
                        </li>
                        <li>
                            <label>考试班级名称：</label>
                            <input type="text" name="deptName"/>
                        </li>
                        <li>
                            <label>考生姓名：</label>
                            <input type="text" name="username"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="btn-group-sm" id="toolbar" role="group">
            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:sysStudentCertificate:export">
                <i class="fa fa-download"></i> 导出
            </a>
        </div>
        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:sysStudentCertificate:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:sysStudentCertificate:remove')}]];
    var prefix = ctx + "system/sysStudentCertificate";

    $(function() {
        var options = {
            url: prefix + "/list",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "培训证书",
            columns: [{
                checkbox: true
            },
                {
                    field: 'id',
                    title: 'ID',
                    visible: false
                },
                {
                    field: 'courseName',
                    title: '课程名称'
                },
                {
                    field: 'deptName',
                    title: '班级名称'
                },
                {
                    field: 'username',
                    title: '考生姓名'
                },
                {
                    field: 'fileUrl',
                    title: '证书照片',
                    formatter: function(value) {
                        if (value) {
                            return '<a href="javascript:void(0)" onclick="window.open(\'' + value + '\')">' + "点击查看" + '</a>';
                        }
                        return value;
                    }
                }]
        };
        $.table.init(options);
    });
</script>
</body>
</html>